package com.sskj.base.socket;


import com.sskj.base.Constant;

import org.json.JSONException;
import org.json.JSONObject;

public class PankouWebSocket extends WebSocket {


    public static PankouWebSocket instance;


    public static PankouWebSocket getInstance(String message) {
        JSONObject text = new JSONObject();
        try {
            text.put("code", message);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        if (instance == null) {
            instance = new PankouWebSocket(Constant.PANKOU_WS, "pankou", text.toString());
        } else {
            instance.sendMessage(text.toString());
        }
        return instance;
    }

    public static PankouWebSocket getInstance(String url, String tag, String message) {
        if (instance == null) {
            instance = new PankouWebSocket(url, tag, message);
        }
        return instance;
    }

    private PankouWebSocket(String url, String tag, String message) {
        super(url, tag, message);
        isLog = false;
    }

    private PankouWebSocket(String url, String tag, String message, boolean isSSL) {
        super(url, tag, message, isSSL);
    }


}
